<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich" xml:lang="en">
<head>
<title>考核方案添加</title>
<meta http-equiv="keywords" content="enter,your,keywords,here" />
<meta http-equiv="description"
	content="A short description of this page." />
<link
	href="#{facesContext.externalContext.requestContextPath}/css/public.css"
	rel="stylesheet" type="text/css" media="screen" />
<link
	href="#{facesContext.externalContext.requestContextPath}/css/main.css"
	rel="stylesheet" type="text/css" media="screen" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<!-- rich:message style-->
<style type="text/css">
	.rich-message-label{
		color:red;
	}
</style>
</head>
<body style="background-color: #ffffff">
<script type="text/javascript">		
//<![CDATA[  
	function ifShowDiv(obj) {
		var selectedbValue = obj.value;
		if (selectedbValue == "1") {
			document.getElementById("zdArea").style.display = '';
			document.getElementById("sdArea").style.display = 'none';
		} else if (selectedbValue == "2") {
			document.getElementById("zdArea").style.display = 'none';
			document.getElementById("sdArea").style.display = '';
		} 
		setType();
	}

	function setType(){
		var type0=document.getElementById("addid:type0");
		var type0_value=type0.options[type0.selectedIndex].value;
		var type0_text=type0.options[type0.selectedIndex].text;
		//alert(type0_text)
		//alert(document.getElementById("addid:type0"))
		var type1=document.getElementById("queryForm:userkind_zd");
		var type1_options=type1.options;
		type1.options[0].selected=true;
		type1.options[0].value=type0_value;
		type1.options[0].text=type0_text;

		var type2=document.getElementById("query1Form:userkind_sd");
		var type2_options=type2.options;
		type2.options[0].selected=true;
		type2.options[0].value=type0_value;
		type2.options[0].text=type0_text;
		
		//set hidden value
		//alert(type0_value)
		document.getElementById("queryForm:queryKindType").value=type0_value;
		document.getElementById("query1Form:queryKindType").value=type0_value;
		//alert(document.getElementById("queryForm:queryKindType").value)
	}
	//]]>
</script>
<div id="right"><a4j:form id="addid">
	<div class="error pt10p bcf c0 tal" style="display: "><a4j:outputPanel
		id="msgPanel">
		<center><h:outputText styleClass="cff" value="#{TrainBB.msg}" /></center>
	</a4j:outputPanel></div>
	<div class="tablelist">
	<table width="100%" border="1" cellpadding="0" cellspacing="0"
		bordercolor="#c3c3c3" style="border-collapse: collapse">
		<tr>
			<h:inputHidden id="tp_e_id" value="#{TrainBB.mappine.tp_e_id}" />
			<td><span class="cff">*</span>考核名称<h:inputText id="tp_e_aim"
				class="style_input" value="#{TrainBB.examinebank.tp_e_aim}" 
				required="true" ><f:validateLength minimum="2" maximum="100" /></h:inputText></td>
			<td><span class="cff">*</span>技能组<h:selectOneMenu id="type0" onchange="setType();"
				class="style_input" value="#{TrainBB.examinebank.tp_userkind}">
				<f:selectItem />
				<f:selectItems value="#{paramBB.selectItems_param}" />
			</h:selectOneMenu></td>
		</tr>
		<tr>
			<td><rich:message for="tp_e_aim" showSummary="true" showDetail="false" /></td>
			<td></td>
		</tr>
		<tr>
			<td class="yellow"><span class="cff">*</span>开始日期 <rich:calendar id="begindate"
				datePattern="yyyy-MM-dd" value="#{TrainBB.examinebank.tp_usedbegin}"
				required="true" /></td>
			<td class="yellow"><span class="cff">*</span>终止日期 <rich:calendar id="enddate"
				value="#{TrainBB.examinebank.tp_usedend}" datePattern="yyyy-MM-dd"
				required="true" /></td>
		</tr>
		<tr>
			<td><rich:message for="begindate" showSummary="true" showDetail="false" /></td>
			<td><rich:message for="enddate" showSummary="true" showDetail="false" /></td>
		</tr>
		<tr>
			<td><span class="cff">*</span>时间要求(分钟)<h:inputText id="tp_t_time"
				class="style_input" value="#{TrainBB.examinebank.tp_t_time}" validator="#{validatorBB.numValidate}"
				required="true">
				<f:validateLength minimum="1"/>
				<f:validateLength maximum="4"/>
				</h:inputText></td>
			<td></td>
		</tr>
		<tr>
			<td><rich:message for="tp_t_time" showSummary="true" showDetail="false" /></td>
			<td></td>
		</tr>
		<tr>
			<td class="yellow" colspan="2">备注信息 <label> <h:inputTextarea
				id="tp_e_mark" class="style_textarea" value="#{TrainBB.examinebank.tp_e_mark}" >
				<f:validateLength  maximum="200" /></h:inputTextarea>
			</label><span class="notice"><rich:message for="tp_e_mark" showSummary="true" showDetail="false" /></span></td>
		</tr>
	</table>
	</div>
	<div class="listbut"><a4j:commandButton styleClass="buttonbg"  oncomplete="setType();"
		value="保存" action="#{TrainBB.saveOrUpdateQualifor}" reRender="tp_e_id_zd,tp_e_id_sd,msgPanel,msgPanel_,userkind_sd,userkind_zd,aaaaaaaaaaa">
		<f:param name="planid" value="#{TrainBB.examinebank.tp_trainplanid}" />
	</a4j:commandButton></div>
</a4j:form>
<div class="error pt10p bcf c0 tal" style="display: "><a4j:outputPanel
		id="msgPanel_">
		<center><h:outputText styleClass="cff" value="#{TrainBB.msg}" /></center>
	</a4j:outputPanel></div>
<div class="biaoqian" style=" height : 30px;width: 98%"> 
	<center>选择生成试卷类型<h:selectOneMenu id="selectComp"
	class="style_input" onchange="ifShowDiv(this);" >
	<f:selectItems value="#{paramBB.selectItem['tp_create_qus_kind']}" />
</h:selectOneMenu></center>
</div>
<a4j:form id="queryForm">
	<h:inputHidden id="queryKindType" name="queryKindType" value=""/>
	<div id="zdArea" class="tablelist" style="display: ''">
	<table width="100%" border="1" cellpadding="0" cellspacing="0"
		bordercolor="#c3c3c3" style="border-collapse: collapse">
		<tr><td colspan="4"><span class="cff">*</span>技能组<h:selectOneMenu id="userkind_zd" disabled="true"
				class="style_input" value="#{TrainBB.tp_userkind}">
				<f:selectItem />
				<f:selectItems value="#{paramBB.selectItems_param}" />
			</h:selectOneMenu></td></tr>
		<tr>
			<td>单选题 </td>
			<td>简单题数量<h:inputText
				class="style_input" value="#{TrainBB.type1_count1}" /></td>
			<td>中等题数量<h:inputText
				class="style_input" value="#{TrainBB.type1_count2}" /></td>
			<td>困难题数量<h:inputText
				class="style_input" value="#{TrainBB.type1_count3}" /></td>
			<td>超难题数量<h:inputText
				class="style_input" value="#{TrainBB.type1_count4}" /></td>
		</tr>
		<tr>
			<td>判断题</td>
			<td>简单题数量<h:inputText
				class="style_input" value="#{TrainBB.type2_count1}" /></td>
			<td>中等题数量<h:inputText
				class="style_input" value="#{TrainBB.type2_count2}" /></td>
			<td>困难题数量<h:inputText
				class="style_input" value="#{TrainBB.type2_count3}" /></td>
			<td>超难题数量<h:inputText
				class="style_input" value="#{TrainBB.type2_count4}" /></td>
		</tr>
		<tr>
			<td>多选题</td>
			<td>简单题数量<h:inputText
				class="style_input" value="#{TrainBB.type3_count1}" /></td>
			<td>中等题数量<h:inputText
				class="style_input" value="#{TrainBB.type3_count2}" /></td>
			<td>困难题数量<h:inputText
				class="style_input" value="#{TrainBB.type3_count3}" /></td>
			<td>超难题数量<h:inputText
				class="style_input" value="#{TrainBB.type3_count4}" /></td>
		</tr>
	</table>
	<div class="listbut" ><a4j:commandButton id="tp_e_id_zd" styleClass="buttonbg"
		value="保存" action="#{TrainBB.addAutoQualiforAndExaminebank}" reRender="msgPanel,msgPanel_">
			<f:param name="tp_e_id_zd" value="#{TrainBB.mappine.tp_e_id}" />
		</a4j:commandButton>
		<h:commandButton styleClass="buttonbg" value="返回" action="#{TrainBB.toBack}" immediate="true"/></div>
	</div>
</a4j:form> 
<a4j:form id="query1Form">
	<h:inputHidden id="queryKindType" name="queryKindType" value=""/>
	<div id="sdArea" style="display:none" class="tablelist">
	<table width="100%" border="1" cellpadding="0" cellspacing="0"
		bordercolor="#c3c3c3" style="border-collapse: collapse">
		<tr>
			<td>office<h:selectOneMenu
				class="style_input" value="#{TrainBB.office_code}">
				<f:selectItem />
				<f:selectItems value="#{otherParamBB.selectItems_officeInfId}" />
			</h:selectOneMenu></td>
			<td>技能组<h:selectOneMenu  id="userkind_sd" disabled="true"
				class="style_input" value="#{TrainBB.tp_userkind}">
				<f:selectItem />
				<f:selectItems value="#{paramBB.selectItems_param}" />
			</h:selectOneMenu></td>
			<td>操作日期 <rich:calendar datePattern="yyyy-MM-dd" value="#{TrainBB.question_op_date}" /></td>
			<td></td>
		</tr>
		<tr>
			<td>题 目<h:inputText
				class="style_input" value="#{TrainBB.tp_question_keyWord}" /></td>
			<td>题目类型 <h:selectOneMenu
				class="style_input" value="#{TrainBB.tp_question_type}">
				<f:selectItem />
				<f:selectItems value="#{paramBB.selectItem['tp_question_type']}" />
			</h:selectOneMenu></td>
			<td>考题类别<h:selectOneMenu
							class="style_input" value="#{TrainBB.tp_classid}">
							<f:selectItem itemValue="0" itemLabel="" />
							<f:selectItems value="#{otherParamBB.selectItems_questionClasss}" />
						</h:selectOneMenu>
			</td>
			<td><a4j:commandButton value="查询" styleClass="buttonbg"
				action="#{TrainBB.queryQuestions}"
 				reRender="subjecttable,msgPanel,msgPanel_" /></td>
		</tr>
	</table>
	<rich:dataTable rowClasses=",yellow" width="100%" id="subjecttable"
		value="#{TrainBB.questionsbanks}" var="table">
		<a4j:keepAlive beanName="TrainBB" />
		<f:facet name="header">
			<rich:columnGroup>
				<rich:column>
					<h:outputText value="选择" />
				</rich:column>
				<rich:column>
					<h:outputText value="office" />
				</rich:column>
				<rich:column>
					<h:outputText value="题目" />
				</rich:column>
				<rich:column>
					<h:outputText value="答案代码" />
				</rich:column>
				<rich:column>
					<h:outputText value="答案描述" />
				</rich:column>
				<rich:column>
					<h:outputText value="题目类型" />
				</rich:column>
				<rich:column>
					<h:outputText value="题目类别" />
				</rich:column>
				<rich:column>
					<h:outputText value="难易程度" />
				</rich:column>
				<rich:column>
					<h:outputText value="分值" />
				</rich:column>
				<rich:column>
					<h:outputText value="技能组" />
				</rich:column>
				<rich:column>
					<h:outputText value="操作人" />
				</rich:column>
				<rich:column>
					<h:outputText value="操作日期" />
				</rich:column>
			</rich:columnGroup>
		</f:facet>
		<rich:columnGroup>
			<rich:column>
				<h:selectBooleanCheckbox value="#{table.select}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.office_code_value}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.tp_question}" >
					<f:converter converterId="HeadingConverter"/>
				</h:outputText>
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.tp_answer_code}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.tp_answer}"  >
					<f:converter converterId="HeadingConverter"/>
				</h:outputText>
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.tp_question_type_value}" />
			</rich:column>
				<rich:column>
				<h:outputText value="#{table.tp_classid_value}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.tp_difficulty_value}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.tp_point}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.tp_userkind_value}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.op}" />
			</rich:column>
			<rich:column>
				<h:outputText value="#{table.op_date}" >
					<f:convertDateTime pattern="yyyy-MM-dd" timeZone="GMT+8" />
				</h:outputText>
			</rich:column>
		</rich:columnGroup>
	</rich:dataTable>
	<div class="listbut"><a4j:commandButton id=	"tp_e_id_sd" styleClass="buttonbg"
		value="保存" action="#{TrainBB.addManualQualiforAndExaminebank}" reRender="msgPanel,msgPanel_">
			<f:param name="tp_e_id_sd" value="#{TrainBB.mappine.tp_e_id}" />
		</a4j:commandButton><h:commandButton
		styleClass="buttonbg" value="返回" action="#{TrainBB.toBack}" immediate="true"/>
	</div>
	</div>
</a4j:form></div>
</body>
</html>
